#!/bin/bash

for folder in $1/*; do
  if [ -d "$folder" ]; then
    project="$(basename -- $folder)"
    version="$(cat $folder/version)"

    echo "Pushing" $project $version
    echo "$(docker build . -f $folder/Dockerfile -t registry-kyc.neo.loan/$project:$version)"
    echo "$(docker push registry-kyc.neo.loan/$project:$version)"
  fi
done